
#[test]
fn test_run() {
	use std::{thread::sleep, time::Duration};

	use tools::global_defin::tokio_runtime::get_rt;
	use tracing::info;

	use crate::{
		audio_codes::AudioCodes,
		wav::{control::load_wav_bufs, file::WriteWavFile},
	};

	let rt = tools::global_defin::tokio_runtime::get_rt();
	let _rt_g = rt.enter();
	let _log = tools::global_defin::trace_log::init_tracing_log();

	tracing::debug!("开始执行");
	let h = get_rt().spawn(async {
		let wb = load_wav_bufs("20240513203151.wav").await.unwrap();

		// info!("wav:{wb:?}");

		let mut wf = WriteWavFile::new("abc2.wav".to_owned(), AudioCodes::G711A, 1)
			.await
			.unwrap();

		let _ = wf.write_wav_file_buf(&wb.data, true).await;
		let _ = wf.write_wav_file_end().await;
	});

	while !h.is_finished() {
		sleep(Duration::from_secs(1));
	}

	info!("执行完成");
}
